package com.vodone.v1pin.productlist.vo
{
	[Bindable]
	public class ActivityVO
	{
		public function ActivityVO( obj:Object = null )
		{
			if( null != obj )
			{
				parseData( obj );
			}
		}
		
		private function parseData( obj:Object ):void
		{
			if( obj.hasOwnProperty("size"))
			{
				this.size = obj["size"];
				if( size == 1 )
				{
					rowSize = 1;
					columnSize = 3;
				}
				else
				{
					rowSize = 2;
					columnSize = 2;
				}
			}
			if( obj.hasOwnProperty("pic"))
			{
				this.pic = obj["pic"];
			}
			if( obj.hasOwnProperty("url"))
			{
				this.url = obj["url"];
			}
		}
		/**
		 * 行高 
		 */		
		public var rowSize:int;
		/**
		 * 列宽
		 */		
		public var columnSize:int;
		private var _size:int = 1;

		/**
		 * 1表示1*3,2表示2*2 
		 */
		public function get size():int
		{
			return _size;
		}
		/**
		 * 
		 */
		public function set size(value:int):void
		{
			_size = value;
			switch( _size )
			{
				case 1:
					rowSize = 1;
					columnSize = 3;
					break;
				case 2:
					rowSize = 2;
					columnSize = 2;
					break;
			}
		}

		/**
		 * 活动图片地址 
		 */		
		public var pic:String;
		/**
		 * 活动链接地址 
		 */		
		public var url:String;
	}
}